package com.wing.order.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wing.order.model.entity.InventoryInout;
import com.wing.order.model.response.InventoryInoutVO;
import com.wing.product.model.response.ProductDetailVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 入库单-Dao
 *
 * @author
 */
@Mapper
public interface InventoryInoutDao extends BaseMapper<InventoryInout> {

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<InventoryInoutVO> list4app(@Param("params") Map<String, Object> params);

    /**
     * 分页列表-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    List<InventoryInoutVO> list4app(@Param("page") Page<InventoryInoutVO> page, @Param("params") Map<String, Object> params);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    InventoryInoutVO get4appById(Long id);

    /**
     * 入库单列表
     * @param page
     * @param queryWrapper
     * @return
     */
    public Page<InventoryInout> getInventoryInoutPageList (IPage<InventoryInout> page, @Param("ew") QueryWrapper<InventoryInout> queryWrapper);

    public Page<InventoryInoutVO> getInventoryAllPageList (IPage<InventoryInoutVO> page, @Param("ew") QueryWrapper<InventoryInoutVO> queryWrapper);

    /**
     * 查询入库计划详情
     * @return
     */
    InventoryInoutVO getInventoryInoutVOInfo(@Param("planId") Long planId);


    Map findProduct(String skuCode);

    List<Long> findWarehouseId(String skuCode);

    List<Map> findWarehouseInforById(@Param("id")Long id,@Param("skuCode")String skuCode);

    Long queryProductStockNum(String skuCode);

    List<Map> queryProductBoxList(@Param("skuCode")String skuCode,@Param("id")Long id);

    Page<ProductDetailVO> getInventoryProductDetailPageList(IPage<ProductDetailVO> iPage);

    List<ProductDetailVO> getProductList(@Param("page")Page<ProductDetailVO> pg, @Param("params")Map params);
}
